#include<bits/stdc++.h>

using i32 = signed;
using u32 = unsigned;
using i64 = long long;
using u64 = unsigned long long;

int main() {
	
	std::ios::sync_with_stdio(false);
	std::cin.tie(0);

	int n;
	std::cin >> n;
	if(n % 4 != 0) {
		std::cout << "365";
	}else if(n % 4 == 0 && n % 100 != 0) {
		std::cout << "366";
	}else if(n % 100 == 0 && n % 400 != 0) {
		std::cout << "365";
	}else if(n % 400 == 0) {
		std::cout << "366";
	}

	return 0;
}